import React, { Component } from 'react'
import { connect } from 'react-redux'
import action from '../../store/module/good/action'

class Shop extends Component {
    componentDidMount () {
        this.props.getData()
    }

    render () {
        return (
            <ul>
                {this.props.list}
            </ul>
        )
    }
}

const mapStateToProps = function (state) {
    return {
        list: state.goods.mounts
    }
}

const mapActionToProps = function (dispatch) {
    return {
        getData: function () {
            dispatch(action.getShopDataList)
        }
    }
}

export default connect(mapStateToProps, mapActionToProps)(Shop)
